package com.zhu.biz;

import com.zhu.entity.TGroup;
import com.zhu.mapper.TGroupMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;


/**
 * Created by zhu on 2016/11/27.
 */
@Service
public class UserBiz {
    private final Logger log = LoggerFactory.getLogger(this.getClass());
    @Autowired
    TGroupMapper tGroupMapper;

    public TGroup mapperTest(){
        TGroup tGroup = new TGroup();
        String id = "111";
        tGroup.setId(id);
        tGroupMapper.insert(tGroup);
        System.out.println(tGroupMapper.find(tGroup));
        System.out.println(tGroupMapper.findOne("111"));
        tGroupMapper.delete(tGroup);
        tGroupMapper.deleteOne("111");
        tGroup.setId("222");
        tGroup.setDelFlag(1);
        tGroupMapper.update(tGroup);
        tGroup.setUpdateDate(new Date());
        tGroupMapper.updateWithAllFields(tGroup);

        return null;
    }

}
